package com.db.cm.app.controller;


import com.db.cm.app.model.ClientDO;
import com.db.cm.app.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author YOURSLIHUA
 * @since 2023-11-24
 */
@RestController
@RequestMapping("/clientDO")
public class ClientController {

    @Autowired
    ClientService clientService;

    @PostMapping("/add")
    public boolean add(@RequestParam ClientDO clientDO){
       return clientService.add(clientDO);
    }
    @PostMapping("/delete")
    public boolean deleteById(@RequestParam ClientDO clientDO) {

       return clientService.delete(clientDO);
    }

    @PostMapping("/update")
    public boolean update(@RequestParam ClientDO clientDO) {

      return  clientService.delete(clientDO);
    }
    @PostMapping("/selectAll")
    public List<ClientDO> selectAll() {
       return clientService.selectAll();
    }

    @PostMapping("/selectById")
    public ClientDO selectById(@RequestParam ClientDO clientDO) {

       return clientService.selectById(clientDO.getClientId());
    }



}

